import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysUserSetting = (params) => {
  params.head.transCode = 'querySysUserSetting';
  return request({
    url: '/platform/sysUserSetting/querySysUserSetting',
    method: 'post',
    data: params
  })
}
//获取租户及用户设置
export const querySysTenantUserSetting = (params) => {
  params.head.transCode = 'querySysTenantUserSetting';
  return request({
    url: '/platform/sysUserSetting/querySysTenantUserSetting',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysUserSettingListPage = (params) => {
  params.head.transCode = 'querySysUserSettingListPage';
  return request({
    url: '/platform/sysUserSetting/querySysUserSettingListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysUserSetting = (params) => {
  params.head.transCode = 'saveSysUserSetting';
  return request({
    url: '/platform/sysUserSetting/saveSysUserSetting',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysUserSettingList = (params) => {
  params.head.transCode = 'saveSysUserSettingList';
  return request({
    url: '/platform/sysUserSetting/saveSysUserSettingList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysUserSetting = (params) => {
  params.head.transCode = 'saveOrUpdateSysUserSetting';
  return request({
    url: '/platform/sysUserSetting/saveOrUpdateSysUserSetting',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysUserSettingList = (params) => {
  params.head.transCode = 'saveOrUpdateSysUserSettingList';
  return request({
    url: '/platform/sysUserSetting/saveOrUpdateSysUserSettingList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysUserSetting = (params) => {
  params.head.transCode = 'updateSysUserSetting';
  return request({
    url: '/platform/sysUserSetting/updateSysUserSetting',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysUserSetting = (params) => {
  params.head.transCode = 'deleteSysUserSetting';
  return request({
    url: '/platform/sysUserSetting/deleteSysUserSetting',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysUserSettingList = (params) => {
  params.head.transCode = 'deleteSysUserSettingList';
  return request({
    url: '/platform/sysUserSetting/deleteSysUserSettingList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysUserSettingExcel = (params) => {
  downloadExcel({
    url: '/platform/sysUserSetting/excelDownload/exportSysUserSettingExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
